﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;

namespace SharedGenomics.Workbench.Services
{
    [Obsolete("This shouldn't really be required...", false)]
    public class WebServiceEndpointRegistry : SharedGenomics.Workbench.Core.IWebServiceEndpointRegistry
    {
        public virtual string GetEndpointForService(string serviceName)
        {
            serviceName.ThrowIfNull("serviceName");

            string propertyName = String.Format("{0}Endpoint", serviceName);
            string endpointUrl = (string)Properties.Settings.Default[propertyName];

            endpointUrl.ThrowIfNull<ArgumentException>(String.Format("Cannot resolve endpoint for {0}", serviceName));

            return endpointUrl;
        }
    }
}
